package b面向对象.day2.demo5_static使用;

public class Test {
    public static void main1(String[] args) {
        Pig p1=new Pig();
        Pig p2=new Pig();
        p1.age=2;
        p2.age=1;

        p2.hobby="吃";
        p1.hobby="睡觉";
        System.out.println(p2.hobby);
        p2.eat();

        Pig.hobby="溜冰";
        System.out.println(Pig.hobby);
        Pig.eat();
    }

    public static void main(String[] args) {
        Pig.eat();

//        Pig p=new Pig();
//        p.m1();
    }
}
